﻿@page "/tables/edit"
@inject IStringLocalizer<TablesEdit> Localizer

<h3>@Localizer["TablesEditTitle"]</h3>
<h4>@((MarkupString)Localizer["TablesEditDescription"].Value)</h4>

<DemoBlock Title="@Localizer["TablesEditItemsTitle"]"
           Introduction="@Localizer["TablesEditItemsIntro"]"
           Name="EditItems"
           Demo="typeof(Demos.Table.TablesEdit.TablesEditItems)">
    <p>@((MarkupString)Localizer["TablesEditItemsDescription"].Value)</p>
</DemoBlock>

<DemoBlock Title="@Localizer["TablesEditTemplateTitle"]"
           Introduction="@Localizer["TablesEditTemplateIntro"]"
           Name="EditTemplate"
           Demo="typeof(Demos.Table.TablesEdit.TablesEditShowSearch)">
    <p>@((MarkupString)Localizer["TablesEditTemplateDescription"].Value)</p>
</DemoBlock>

<DemoBlock Title="@Localizer["TablesEditOnAddAsyncTitle"]"
           Introduction="@Localizer["TablesEditOnAddAsyncIntro"]"
           Name="OnAddAsync"
           Demo="typeof(Demos.Table.TablesEdit.TablesEditOnAddAsync)">
    <p id="anchor2">@((MarkupString)Localizer["TablesEditOnAddAsyncDescription"].Value)</p>
    <p>@((MarkupString)Localizer["TablesEditOnAddAsyncTips1"].Value)</p>
    <p>@((MarkupString)Localizer["TablesEditOnAddAsyncTips2"].Value)</p>
    <p>@((MarkupString)Localizer["TablesEditOnAddAsyncTips3"].Value)</p>
    <p>@((MarkupString)Localizer["TablesEditOnAddAsyncTips4"].Value)</p>
    <p>@((MarkupString)Localizer["TablesEditOnAddAsyncTips5"].Value)</p>
    <p>@((MarkupString)Localizer["TablesEditOnAddAsyncTips6"].Value)</p>
</DemoBlock>

<DemoBlock Title="@Localizer["TablesColumnEditTemplateTitle"]"
           Introduction="@Localizer["TablesColumnEditTemplateIntro"]"
           Name="EditTemplate"
           Demo="typeof(Demos.Table.TablesEdit.TablesEditTemplate)">
    <p>
        <div>@((MarkupString)Localizer["TablesColumnEditTemplateDescription1"].Value)</div>
        <div>@((MarkupString)Localizer["TablesColumnEditTemplateTips"].Value)</div>
    </p>
</DemoBlock>

<DemoBlock Title="@Localizer["TablesEditModeTitle"]"
           Introduction="@Localizer["TablesEditModeIntro"]"
           Name="EditMode"
           Demo="typeof(Demos.Table.TablesEdit.TablesEditMode)">
    <p id="anchor4">@((MarkupString)Localizer["TablesEditModeDescription"].Value)</p>
    <p>@((MarkupString)Localizer["TablesEditModeTips1"].Value)</p>
    <p>@((MarkupString)Localizer["TablesEditModeTips2"].Value)</p>
</DemoBlock>

<DemoBlock Title="@Localizer["TablesEditInjectDataServiceTitle"]"
           Introduction="@Localizer["TablesEditInjectDataServiceIntro"]"
           Name="InjectDataService"
           Demo="typeof(Demos.Table.TablesEdit.TablesEditInjectDataService)">
</DemoBlock>

<DemoBlock Title="@Localizer["TablesEditDataServiceTitle"]"
           Introduction="@Localizer["TablesEditDataServiceIntro"]"
           Name="DataService"
           Demo="typeof(Demos.Table.TablesEdit.TablesEditDataService)">
    <p id="anchor7">
        <b>@Localizer["TablesEditDataServiceDescription"]</b>
        <div class="mt-1">@((MarkupString)Localizer["TablesEditDataServiceTips1"].Value)</div>
        <div class="mt-1">@((MarkupString)Localizer["TablesEditDataServiceTips2"].Value)</div>
    </p>
    <Pre class="no-highlight my-3">services.AddTableDemoDataService();</Pre>
</DemoBlock>

<DemoBlock Title="@Localizer["TablesEditFooterTemplateTitle"]"
           Introduction="@Localizer["TablesEditFooterTemplateIntro"]"
           Name="EditFooterTemplate"
           Demo="typeof(Demos.Table.TablesEdit.TablesEditFooterTemplate)">
    <p>@((MarkupString)Localizer["TablesEditFooterTemplateDescription"].Value)</p>
    <Pre class="mb-3">&lt;EditFooterTemplate Context="model"&gt;
    &lt;Button Text="Popup" Color="Color.Danger" Icon="fa-regular fa-comment-dots" OnClick="() =&gt; OnClick(model)"&gt;&lt;/Button&gt;
    &lt;DialogCloseButton /&gt;
    &lt;DialogSaveButton Color="Color.Primary" Icon="fa-solid fa-floppy-disk" Text="Save" /&gt;
&lt;/EditFooterTemplate&gt;</Pre>
</DemoBlock>
